<%@page contentType="text/html;charset=UTF-8"%> 
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>

	<link type="text/css" rel="stylesheet" href="../resources/css/bootstrap.min.css" />
	<link type="text/css" rel="stylesheet" href="../resources/css/style.css" />
	<script type="text/javascript" src="../resources/js/jquery.js"></script>
	<script type="text/javascript" src="../resources/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="../resources/js/jquery-ui.js"></script>
	<link type="text/css" rel="stylesheet" href="../resources/css/jquery-ui.css" />
	
	<link type="text/css" rel="stylesheet" href="../resources/css/jquery.ui.timepicker.css" />
	<script type="text/javascript" src="../resources/js/jquery.ui.core.min.js"></script>
	<script type="text/javascript" src="../resources/js/jquery.ui.widget.min.js"></script>
	<script type="text/javascript" src="../resources/js/jquery.ui.tabs.min.js"></script>
	<script type="text/javascript" src="../resources/js/jquery.ui.position.min.js"></script>
	<script type="text/javascript" src="../resources/js/jquery.ui.timepicker.js"></script>
	<script>
		$(function() {
			$( "#datepicker" ).datepicker({ dateFormat: 'dd-mm-yy' });
		});
	</script>
	
	 <script type="text/javascript">
            $(document).ready(function() {
                $('#timepicker_batdau').timepicker();
            });
            $(document).ready(function() {
                $('#timepicker_ketthuc').timepicker();
            });

        </script>

 
<form action="/QLKhoaCNTT/capnhatlichlamviec" method="post" class="form-horizontal">
		<c:forEach items="${listLichLamViecForm}" var="lichlamviec">
		
					<div class="form-group">
						<label for="LLV" class="col-lg-3 control-label">Mã</label>
						<div class="col-lg-9">
						<input class="form-control" id="LLV" name="idlichlamviec" value="${lichlamviec.idLichLamViec}" placeholder="Ký hiệu công văn" type="text">
						</div>
					</div><!-- end form-group-->
					<div class="form-group">
						<label for="tuan" class="col-lg-3 control-label">Tuần</label>
						<div class="col-lg-9">
						<input class="form-control" id="tuan" name="tuan" value="${lichlamviec.tuan}" placeholder="Tuần" type="text">
					</div>	
					</div><!-- end form-group-->
					<div class="form-group">
						<label for="Ngay" class="col-lg-3 control-label">Ngày Nhận</label>
						<div class="col-lg-9">
						<input class="form-control" type="text" id="Ngay" name="ngay" value="11-11-2014" placeholder="Ngày Nhận" />
						</div>
					</div><!-- end form-group-->
					<div class="form-group">
						<label for="thoigianbatdau" class="col-lg-3 control-label">Thời gian bắt đầu</label>
						<div class="col-lg-9">
							<input class="form-control"  name="thoigianbatdau" type="text" id="timepicker_batdau" value="<fmt:formatDate value="${lichlamviec.thoiGianBatDau}" pattern="hh:mm" />"  />
						</div>
					</div><!-- end form-group-->
					<div class="form-group">
						<label for="thoigianketthuc" class="col-lg-3 control-label">Thời gian kết thúc</label>
						<div class="col-lg-9">
							<input class="form-control"  name="thoigianketthuc" type="text" id="timepicker_ketthuc" value="<fmt:formatDate value="${lichlamviec.thoiGianKetThuc}" pattern="hh:mm" />"  />
						</div>
					</div><!-- end form-group-->
					<div class="form-group">
						<label for="noidung" class="col-lg-3 control-label">Nội dung</label>
						<div class="col-lg-9">
						<textarea class="form-control" rows="3" id="noidung" name="noidung">${lichlamviec.noiDung}</textarea>
						</div>
					</div><!-- end form-group-->
					<div class="form-group">
						<label for="diadiem" class="col-lg-3 control-label">Địa điểm</label>
						<div class="col-lg-9">
						  <input class="form-control" id="diadiem" name="diadiem" placeholder="Địa điểm" type="text" value="${lichlamviec.diaDiem}" >
						</div>
					</div><!-- end form-group-->
					<div class="form-group">
						<label for="ghichu" class="col-lg-3 control-label">Ghi chú</label>
						<div class="col-lg-9">
						<textarea class="form-control" rows="3" id="ghichu" name="ghichu">${lichlamviec.ghiChu}</textarea>
						</div>
					</div><!-- end form-group-->
					
					<button type="button" class="btn btn-default" data-dismiss="modal">Đóng</button>
					<button type="submit" class="btn btn-primary">Lưu</button>
				</c:forEach>	
		</form><!-- end form -->
			 
<c:if test="${!empty listLichLamViec}">
 <h2 class="day" ><fmt:formatDate value="${ngay}" pattern="dd/MM/yyyy" /></h2>
	<table class="table table-hover">
		<tr>
			<th width="80">Tuần</th>
			<th width="120">Ngày</th>
			<th width="80">Thời gian bắt đầu</th>
			<th width="120">Thời gian kết thúc</th>
			<th width="120">Nội dung</th>
			<th width="120">Địa điểm</th>
			<th width="120">Ghi chú</th>
			<th width="120">Sửa</th>
			<th width="120">Xóa</th>
			
		</tr>
		<c:forEach items="${listLichLamViec}" var="lichlamviec">
		<tr>
			<td>${lichlamviec.tuan}</td>
			 <td>${lichlamviec.ngay}</td>
			 <td>${lichlamviec.thoiGianBatDau}</td>
			 <td>${lichlamviec.thoiGianKetThuc}</td>
			 <td>${lichlamviec.noiDung}</td>
			 <td>${lichlamviec.diaDiem}</td>
			 <td>${lichlamviec.ghiChu}</td>
			 <td><a class="btn btn-primary" href="<c:url value='sualichlamviec/${lichlamviec.idLichLamViec}' />">Sửa</a></td>
			<td><a class="btn btn-primary" href="#">Xóa</a></td>

		 </tr>
		</c:forEach>
	</table>
</c:if>